Skip to content

Comments

[homeassistant] Split Home Assistant from MQTT binding#19496

Merged
lsiepel merged 7 commits intoopenhab:mainfrom
ccutrer:homeassistant-extraction
Nov 23, 2025
Merged

[homeassistant] Split Home Assistant from MQTT binding#19496
lsiepel merged 7 commits intoopenhab:mainfrom
ccutrer:homeassistant-extraction

Conversation

@ccutrer
Copy link
Member

@ccutrer ccutrer commented Oct 17, 2025

This first collapses mqtt.generic into mqtt to simplify and reduce confusion about feature dependencies. Then it moves the Home Assistant sub-binding into its own binding, with just a feature dependency on the MQTT binding. I've tested existing mqtt:homeassistant Things continue to work, and I can create both auto-discovered Home Assistant things (and they come online) and manually created Home Assistant things (as far as finding the bridge) in the UI.

Refs openhab/openhab-core#4878

Depends on openhab/openhab-core#5083

Copy link
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is a big step forward.
All changes i can think of are included, but it is so large, we probably need to test this extensively with snapshots.
It affects multiple mqtt bindings, so they probably all need to be tested in some way, especially installing / runlevels etc.

@ccutrer ccutrer force-pushed the homeassistant-extraction branch from ab0215b to 49a7ddf Compare October 20, 2025 14:20
@ccutrer
Copy link
Member Author

ccutrer commented Oct 20, 2025

I was able to get a KAR built for all of "addons" (by stripping out all unrelated bindings), then removed the built in addons feature repo in my test instance. I was able to confirm that installing the Home Assistant binding automatically installs the MQTT binding just as I expected it to. For uninstallation, it works a little differently than I thought. I can easily uninstall the Home Assistant, and if I had not explicitly installed MQTT binding, it gets removed too. If I had explicitly installed the MQTT binding, it gets left. The change from my expected behavior is that if you have Home Assistant installed, then try to uninstall MQTT... nothing happens. Under the hood, it's just de-selecting MQTT for explicit installation, but because it's an implicit dependency of the Home Assistant feature, it gets left installed. I don't know if this one bit of weirdness is worth updating the addons API and the UI to be able to show "implicitly installed; cannot be removed" or something in this state. I can clearly see the state in the Karaf console under feature:list:

Name                                                  │ Version          │ Required │ State       │ Repository                                                      │ Description                                                                                                            ──────────────────────────────────────────────────────┼──────────────────┼──────────┼─────────────┼─────────────────────────────────────────────────────────────────┼───────────────────────────────────────────────────    
openhab-binding-homeassistant                         │ 5.1.0.SNAPSHOT   │ x        │ Started     │ org.openhab.addons.features.karaf.openhab-addons-5.1.0-SNAPSHOT │ Home Assistant
openhab-binding-mqtt                                  │ 5.1.0.SNAPSHOT   │          │ Started     │ org.openhab.addons.features.karaf.openhab-addons-5.1.0-SNAPSHOT │ MQTT Binding

Once the core PR gets merged, I'll install the bundles to my production installation to get more testing. I also have generic MQTT, Homie, and espmilighthub things, so I'll get good testing exposure. (I'm awaiting the core PR, because having on-off core bundles locally is a huge pain, because anytime a feature gets installed or removed it reverts it, and for many core bundles that can cause most/all of your instance to be broken until you do a restart).

Signed-off-by: Cody Cutrer <cody@cutrer.us>
Signed-off-by: Cody Cutrer <cody@cutrer.us>
Signed-off-by: Cody Cutrer <cody@cutrer.us>
Signed-off-by: Cody Cutrer <cody@cutrer.us>
It fails due to referencing the sibling MQTT feature. So instead add
it to the list of explicitly verified features in the full feature pom.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
Signed-off-by: Cody Cutrer <cody@cutrer.us>
@ccutrer ccutrer force-pushed the homeassistant-extraction branch from 7220ab8 to b56f93b Compare November 22, 2025 23:49
@ccutrer
Copy link
Member Author

ccutrer commented Nov 22, 2025

Rebased and merge conflicts resolved. 🤞 it passes CI now that the XSD caching is merged, too.

it was in mqtt.generic, so needed to be moved to mqtt

Signed-off-by: Cody Cutrer <cody@cutrer.us>
@lsiepel lsiepel merged commit ac8b30a into openhab:main Nov 23, 2025
2 checks passed
@lsiepel lsiepel added the enhancement An enhancement or new feature for an existing add-on label Nov 23, 2025
@lsiepel lsiepel added this to the 5.1 milestone Nov 23, 2025
@lsiepel
Copy link
Contributor

lsiepel commented Nov 23, 2025

I guess there are certain situations that it can be considered a breaking change. Should we add a upgrade notification to the distro repo? wdyt?

@ccutrer
Copy link
Member Author

ccutrer commented Nov 23, 2025

Yes, I agree. If only because it won't auto-select the new feature.

@ccutrer ccutrer deleted the homeassistant-extraction branch November 23, 2025 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement An enhancement or new feature for an existing add-on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants